#!/usr/bin/env python3.3

#
#  Filename: e36.py
#  Author  : lukas singer
#
#  Comment : Created by createSolution.sh
#

#import euler
#from euler import isPalindrome

def pe36():
  #one line with euler.py-lib:
#  print(sum(i for i in range(1,1000000,2) if isPalindrome(i) and isPalindrome(bin(i)[2:])))
  #one line without euler.py-lib:
  print(sum(i for i in range(1,1000000,2)if str(i)==str(i)[::-1] and bin(i)[2:]==bin(i)[2:][::-1]))

if __name__=="__main__":
  pe36()

